package cn.itheima.feign;

import cn.itcast.result.Result;
import cn.itheima.users.pojo.User;
import cn.itheima.users.vo.UserReportVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.util.List;

@FeignClient(name="sky-users",contextId = "user")
public interface UserClient {

    @GetMapping("/user/user/{id}")
    Result<User> getById(@PathVariable long id);

    @GetMapping("/user/user/countByTime")
    List<UserReportVO> countByTime(@RequestParam("begin")LocalDate begin, @RequestParam("end")LocalDate end);
}
